<?php include_once __DIR__.'/../inc/tie_head.html';?>
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8">
      <div class="fly-panel">
        <div class="fly-panel-title fly-filter">
          <a>置顶</a>
          <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>
        </div>
        <ul class="fly-list">
        <?php foreach($zd as $v):?>
          <li>
            <a href="<?=url('user/index').'?id='.$v['user_id']?>" class="fly-avatar">
              <img src="<?=$v['pic']?$v['pic']:'/static/www/images/avatar/default.png';?>" alt="<?=$v['username']?>">
            </a>
            <h2>
              <a class="layui-badge"><?=$v['cat_title']?></a>
              <a href="<?=url('tie/detail').'?id='.$v['id']?>"><?=$v['title']?></a>
            </h2>
            <div class="fly-list-info">
              <a href="<?=url('user/index').'?id='.$v['id']?>" link>
                  <cite><?=$v['username']?></cite>
                <?php if($v['level']):?>
                <i class="layui-badge fly-badge-vip">VIP<?=$v['level']?></i>
                <?php endif;?>
              </a>
              <span><?=com_time_format($v['create_time'],'f');?></span>
              <?php if($v['score']):?>
              <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> <?=$v['score']?></span>
              <?php endif;?>
              <?php if( $v['is_cn']):?>
              <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
              <?php endif;?>
              <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="回答"></i> <?=$v['reply_count']?>
              </span>
            </div>
            <div class="fly-list-badge">
              <?php if( $v['is_zd']):?>
              <span class="layui-badge layui-bg-black">置顶</span>
              <?php endif;?>
              <?php if( $v['is_jh']):?>
              <span class="layui-badge layui-bg-red">精帖</span>
              <?php endif;?>
            </div>
          </li>
        <?php endforeach;?>
        </ul>
      </div>

      <div class="fly-panel" style="margin-bottom: 0;">
        <div class="fly-panel-title fly-filter">
          <a href="<?=url('tie/lists',['type'=>'all'])?>" class="layui-this">综合</a>
          <span class="fly-mid"></span>
          <a href="<?=url('tie/lists',['type'=>'uncn'])?>">未结</a>
          <span class="fly-mid"></span>
          <a href="<?=url('tie/lists',['type'=>'cn'])?>">已结</a>
          <span class="fly-mid"></span>
          <a href="<?=url('tie/lists',['type'=>'jh'])?>">精华</a>
        </div>

        <ul class="fly-list">
        <?php foreach($list as $v):?>
          <li>
            <a href="<?=url('user/index').'?id='.$v['user_id']?>" class="fly-avatar">
              <img src="<?=$v['pic']?$v['pic']:'/static/www/images/avatar/default.png';?>" alt="<?=$v['username']?>">
            </a>
            <h2>
              <a class="layui-badge"><?=$v['cat_title']?></a>
              <a href="<?=url('tie/detail').'?id='.$v['id']?>"><?=$v['title']?></a>
            </h2>
            <div class="fly-list-info">
              <a href="<?=url('user/index').'?id='.$v['id']?>" link>
                  <cite><?=$v['username']?></cite>
                <?php if($v['level']):?>
                <i class="layui-badge fly-badge-vip">VIP<?=$v['level']?></i>
                <?php endif;?>
              </a>
              <span><?=com_time_format($v['create_time'],'f');?></span>
              <?php if($v['score']):?>
              <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> <?=$v['score']?></span>
              <?php endif;?>
              <?php if( $v['is_cn']):?>
              <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
              <?php endif;?>
              <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="回答"></i> <?=$v['reply_count']?>
              </span>
            </div>
            <div class="fly-list-badge">
              <?php if( $v['is_zd']):?>
              <span class="layui-badge layui-bg-black">置顶</span>
              <?php endif;?>
              <?php if( $v['is_jh']):?>
              <span class="layui-badge layui-bg-red">精帖</span>
              <?php endif;?>
            </div>
          </li>
        <?php endforeach;?>
        </ul>
        <div style="text-align: center">
          <div class="laypage-main">
            <a href="<?=url('tie/lists',['type'=>'all'])?>" class="laypage-next">更多求解</a>
          </div>
        </div>

      </div>
    </div>
    <div class="layui-col-md4">

      <?php if($userinfo):?>
      <div class="fly-panel">
        <h3 class="fly-panel-title">个人中心</h3>
        <div class="fly-panel-main">
          <input  id="foo" type="text" class="layui-input" value="<?=url('bbs/tie/init',['uid'=>$userinfo['id']])?>">
          <div>
            <button class="layui-btn layui-btn-danger copy_url" data-clipboard-target="#foo">复制推广</button>
            <span style="font-size:10px;color:#ccc;">已推广: <?=$sub_user?>人</span>
          </div>

          </div>
      </div>
      <?php endif;?>
      <div class="fly-panel">
        <h3 class="fly-panel-title">蚂蚁项目</h3>
        <div class="layui-row fly-panel-main myb_xiangmu" style="padding: 15px;">
          <div class="layui-clear fly-list-quick">
            <?php foreach($xiangmu as $v):?>
            <div class="layui-col-xs6">
              <div> <a href="javascript:checkLogin('<?=$v['admin_url']?>')" <?php if(in_array($v['id'], $my_xiangmu)):?>style="color:#5FB878;"<?php endif;?>><?=$v['title']?></a></div>
            </div>
            <?php endforeach;?>
            <a name="signin"> </a>
          </div>
        </div>
      </div>

      <div class="fly-panel">
        <h3 class="fly-panel-title">官方客服群</h3>
        <div class="fly-panel-main">
          <div class="fly-panel-main">
              <a href="<?=$qun[1]?>" target="_blank" class="fly-zanzhu" style="background-color: #009688;">QQ群-<?=$qun[0]?></a>
              <div id="tong" style="display:none;padding:20px;" ><img style="width:200px;height:200px;" src="<?=$qun[2]?>"></div>
              <a href="javascript:layer.open({type:1,title:'扫码加入微信群',area:'400px',content: $('#tong')})" class="fly-zanzhu" style="background-color: #20222A;">微信群-点击扫码加入</a>
          </div>
        </div>
      </div>

      <div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
        <h3 class="fly-panel-title">会员榜</h3>
        <dl>
          <!--<i class="layui-icon fly-loading">&#xe63d;</i>-->
          <?php foreach($user as $v):?>
          <dd>
            <a href="<?=url('user/index',['id'=>$v['id']])?>">
              <img src="<?=isset($v['pic'])?$v['pic']:'/static/www/images/avatar/default.png'?>"><cite><?=$v['username']?></cite><i><?=$v['tie_count']?>次发帖</i>
            </a>
          </dd>
          <?php endforeach;?>
          <?php if(count($user)<1):?>
          <div class="fly-none">没有相关数据</div>
          <?php endif;?>
        </dl>
      </div>
      <?php include_once __DIR__.'/../inc/tie_hot.html';?>
    </div>
  </div>
</div>
<script>
var clipboard = new ClipboardJS('.copy_url');
clipboard.on('success', function(e) {
    layer.msg('复制推广链接成功!');
});

clipboard.on('error', function(e) {
    layer.msg('浏览器不支持复制, 请手动复制推广链接');
});

</script>
